home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1994 March / Internet Info CD-ROM (Walnut Creek) (March 1994).iso / networking / terms / kermit / b / ikxmac.asm < prev    next >
Encoding:
Assembly Source File  |  1992-09-29  |  44.4 KB  |  562 lines

  1. *COPY                                                 RTEXT             00800000
  2.          MACRO                                                          00801000
  3. &LABEL   RTEXT  &BUF,&PROMPT=,&E=                                       00802000
  4. .* Read from the terminal, possible prompt.  Get length read in R0.     00803000
  5. .*  &1: read buffer (len=130) (LA), &PROMPT(1)= prompt buf. if any      00804000
  6. .*  (LA/R), &PROMPT(2)= prompt length (LA/R), &E= branch if error       00805000
  7.          GBLC  &KVRSN,&KSYS                                    @SC89027 00806000
  8.          AIF   ('&KVRSN' EQ '4.2' OR '&KSYS' EQ '').VOK        @SC90072 00807000
  9.    MNOTE 16,'* * * --> IKXMAC version number should be &KVRSN' @SC89027 00808000
  10. .VOK     ANOP                                                  @SC89027 00809000
  11. &LABEL   DS    0H                                              @SC86299 00810000
  12.          AIF   (T'&BUF EQ 'O').ERRB                            @SC87268 00811000
  13.          AIF   (T'&PROMPT EQ 'O').NOPR                         @SC87268 00812000
  14.          AIF   (N'&PROMPT NE 2).ERRP                           @SC87268 00813000
  15.          AIF   ('&PROMPT(1)' EQ '' OR '&PROMPT(2)' EQ '').ERRP @SC87268 00814000
  16.          LREG  1,&PROMPT(1)                                    @SC90264 00815000
  17.          LREG  0,&PROMPT(2)                                    @SC90264 00816000
  18.          STM   0,1,GTLPRPS   Save prompt ptrs                  @SC90264 00817000
  19.          AGO   .GETL                                           @SC90264 00818000
  20. .NOPR    XC    GTLPRPS,GTLPRPS                                 @SC90264 00819000
  21. .GETL    KCALL GETLIN,&BUF,E=&E                                @SC88095 00820000
  22.          MEXIT                                                 @SC87268 00821000
  23. .ERRB    MNOTE 2,'BUFFER ADDRESS OMITTED'                      @SC87268 00822000
  24.          MEXIT                                                 @SC87268 00823000
  25. .ERRP    MNOTE 2,'INVALID PROMPT PARAMETER'                    @SC87268 00824000
  26.          MEND                                                           00825000
  27. *COPY                                                 WTEXT             00826000
  28.          MACRO                                                          00827000
  29. &LABEL   WTEXT &ARG,&LEN                                                00828000
  30. .* Display some text, e.g., WTEXT 'Hi there' or WTEXT (3),(4)           00829000
  31. .* Preserves R2-R14                                                     00830000
  32. .*  &1: 'text' (where text has no doubled ' or & characters)  OR        00831000
  33. .*  &1: adr of text (LA/R), &2: length of text (LA/R)                   00832000
  34. &LABEL   PTEXT &ARG,&LEN,AREG=1,LREG=0                         @SC86295 00833000
  35.          BAL   15,WTEXT                                        @SC87020 00834000
  36.          MEND                                                           00835000
  37. *COPY                                                 DMSFREE           00836000
  38.          MACRO                                                          00837000
  39. &LABEL   DMSFREE &DWORDS=(0),&ERR=                                      00838000
  40. .* Obtain free storage block: len=8*(R0).  Returns ptr in R1, but       00839000
  41. .*    preserves registers 2-13                                          00840000
  42. .*  &DWORDS= length in doublewords should be in R0,                     00841000
  43. .*  &ERR= branch if failure                                             00842000
  44. &LABEL   LREG  0,&DWORDS                                       @SC86299 00843000
  45.          SLA   0,3                                             @SC86299 00844000
  46.          ST    0,GTMLEN      Bytes requested                   @SC90264 00845000
  47.          AIF   ('&ERR' EQ '').DOORDIE                          @SC90264 00846000
  48.          EXEC CICS GETMAIN SET(1) FLENGTH(GTMLEN) NOHANDLE,    @SC90264 00847000
  49.          L     15,DFHEIBP                                      @SC90264 00848000
  50.          CLC   F0,EIBRCODE-DFHEIBLK(15)                        @SC90264 00849000
  51.          BNE   &ERR                                            @SC90264 00850000
  52.          AGO   .DONE                                           @SC90264 00851000
  53. .DOORDIE ANOP                                                  @SC90264 00852000
  54.          EXEC CICS GETMAIN SET(1) FLENGTH(GTMLEN),             @SC90264 00853000
  55. .DONE    ANOP                                                  @SC90264 00854000
  56.          MEND                                                           00855000
  57. *COPY                                                 DMSFRET           00856000
  58.          MACRO                                                          00857000
  59. &LABEL   DMSFRET &DWORDS=(0),&LOC=(1),&ERR=                             00858000
  60. .* Return free storage block: len=8*(R0), adr=(R1).  Preserve R2-13.    00859000
  61. .*  &DWORDS= length in doublewords should be in R0, &LOC= adr (in R1),  00860000
  62. .*  &ERR= branch if failure                                             00861000
  63. .*  Note: &DWORDS is ignored                                   @SC90264 00862000
  64. &LABEL   ST    2,GTMSAV                                        @SC90264 00863000
  65.          LREG  2,&LOC                                          @SC90264 00864000
  66.          EXEC CICS FREEMAIN DATA(0(,2)),                       @SC90264 00865000
  67.          L     2,GTMSAV                                        @SC90264 00866000
  68.          MEND                                                           00867000
  69. *COPY                                                 WRITF             00868000
  70.          MACRO                                                          00869000
  71. &LABEL   WRITF &TICK,&BUFFER=,&BSIZE=,&E=                               00870000
  72. .* Write to a disk file (ticket ptr in R1)                              00871000
  73. .*  &1: adr of file access ticket returned by OPENF (A),                00872000
  74. .*  &BUFFER= data ptr (LA/R), &BSIZE= data length (LA/R) - if either is 00873000
  75. .*  given, it replaces FDB value (see OPENF), &E= branch on error       00874000
  76. &LABEL   READF &TICK,BUFFER=&BUFFER,BSIZE=&BSIZE,E=&E,CODE=10           00875000
  77.          MEND                                                           00876000
  78. *COPY                                                 READF             00877000
  79.          MACRO                                                          00878000
  80. &LABEL   READF &TICK,&NONUM,&BUFFER=,&BSIZE=,&E=,&CODE=9                00879000
  81. .* Read from disk file (or write) (see WRITF, but also...)              00880000
  82. .*  &2: NONUM means chop off numbers                                    00881000
  83.          LCLC  &R                                              @SC86299 00882000
  84.          LCLA  &C                                              @SC88101 00883000
  85. &C       SETA  &CODE                                           @SC88101 00884000
  86.          AIF   (T'&NONUM EQ 'O').RDC                           @SC88101 00885000
  87.          AIF   ('&NONUM' NE 'NONUM' OR &CODE NE 9).ER1         @SC88101 00886000
  88. &C       SETA  0             Code 0 means exclude sequence nos.@SC88101 00887000
  89. .RDC     ANOP                                                  @SC88101 00888000
  90. &LABEL   L     1,&TICK                                         @SC86299 00889000
  91.          AIF   ('&BUFFER' EQ '').BZ                            @SC86299 00890000
  92.          AIF   ('&BUFFER'(1,1) NE '(').BLA                     @SC86299 00891000
  93. &R       SETC  '&BUFFER(1)'                                    @SC86299 00892000
  94.          AGO   .BST                                            @SC86299 00893000
  95. .BLA     LA    15,&BUFFER                                      @SC86299 00894000
  96. &R       SETC  '15'                                            @SC86299 00895000
  97. .BST     ST    &R,FDBBUFF-FABD(1)                              @SC86299 00896000
  98. .BZ      AIF   ('&BSIZE' EQ '').SZ                             @SC86299 00897000
  99.          AIF   ('&BSIZE'(1,1) NE '(').SLA                      @SC86299 00898000
  100. &R       SETC  '&BSIZE(1)'                                     @SC86299 00899000
  101.          AGO   .SST                                            @SC86299 00900000
  102. .SLA     LA    15,&BSIZE                                       @SC86299 00901000
  103. &R       SETC  '15'                                            @SC86299 00902000
  104. .SST     ST    &R,FDBBSIZ-FABD(1)                              @SC86299 00903000
  105. .SZ      LA    0,&C                                            @SC88101 00904000
  106.          KCALL DISKIO,E=&E                                     @SC86299 00905000
  107.          MEXIT                                                          00906000
  108. .ER1     MNOTE 2,'INVALID PARAMETER ''&NONUM'''                @SC88101 00907000
  109.          MEND                                                           00908000
  110. *COPY                                                 SAVEF             00909000
  111.          MACRO                                                          00910000
  112. &LABEL   SAVEF &TICK,&E=                                       @SC88168 00911000
  113. .* Update disk directory for given file (ticket ptr in R1)              00912000
  114. .*  &1: adr of file access ticket (A), &E= branch on error              00913000
  115. &LABEL   L     1,&TICK                                         @SC88168 00914000
  116.          READF &TICK,E=&E,CODE=21                              @SC88168 00915000
  117.          MEND                                                           00916000
  118. *COPY                                                 KSETKW            00917000
  119.          MACRO                                                          00918000
  120.          KSETKW ,                                              @SC87166 00919000
  121. .* Define system-specific SET/SHOW parameters (keywords)                00920000
  122.          KW    'DELIM',SHODLM,MIN=4                            @SC88095 00921000
  123.          KW    'PREFIX',SHODST,MIN=3                           @SC87166 00922000
  124.          MEND                                                           00923000
  125. *COPY                                                 KSETPRC           00924000
  126.          MACRO                                                          00925000
  127.          KSETPRC                                                        00926000
  128. .* System-specific SET handlers (in any order).  No operands.           00927000
  129. SETDLM   NTOKN N=SETDLM1,H=SETDLMH                             @SC88095 00928000
  130.          LTR   7,7           Exactly one character?            @SC88095 00929000
  131.          BNZ   SETDLMH       No, explain it                    @SC88095 00930000
  132.          MVC   LNDLM,0(6)    Yes, use that character           @SC88095 00931000
  133.          B     RTRN0                                           @SC88095 00932000
  134. SETDLM1  MVI   LNDLM,C' '    Turn delimiter off                @SC88095 00933000
  135.          B     RTRN0                                           @SC88095 00934000
  136. SETDLMH  PTEXT 'Line delimiter: one char or none'              @SC88095 00935000
  137.          B     SUBERR                                          @SC88095 00936000
  138. SETDST   KCALL CWDSET                                          @SC86164 00937000
  139.          B     RTRN          Preserve return code              @SC86295 00938000
  140.          MEND                                                           00939000
  141. *COPY                                                 KSHOPRC           00940000
  142.          MACRO                                                          00941000
  143.          KSHOPRC                                                        00942000
  144. .* System-specific SHOW handlers (in same order as KW).  No operands.   00943000
  145. SHODLM   LA    8,LNDLM       Show delimiter                    @SC88095 00944000
  146.          BAL   14,SHOCHR                                       @SC88095 00945000
  147.           B    SETDLM                                          @SC88095 00946000
  148. SHODST   LA    8,DEST                                          @SC86316 00947000
  149.          LH    9,DESTL       Get length                        @SC86316 00948000
  150.          BAL   14,SHOCHRN                                      @SC86295 00949000
  151.           B    SETDST                                          @SC87166 00950000
  152.          MEND                                                           00951000
  153. *COPY                                                 KFILKW            00952000
  154.          MACRO                                                          00953000
  155.          KFILKW ,                                              @SC87166 00954000
  156. .* Define system-specific file attribute parameters (keywords)          00955000
  157.          KW    'RECFM',SHORFM                                  @SC87166 00956000
  158.          MEND                                                           00957000
  159. *COPY                                                 KFILSET           00958000
  160.          MACRO                                                          00959000
  161.          KFILSET                                                        00960000
  162. .* Specific SET FILE handlers (any order).  No operands.                00961000
  163. SETRECVF MVC   FILRCF,OPRND  Copy RECFM                        @SC91033 00962000
  164.          B     RTRN0                                           @SC87012 00963000
  165. *                                                              @SC87012 00964000
  166. SETRFM   BAL   4,SETSCN                                        @SC87012 00965000
  167.          KW    'FIXED',SETRECVF                                @SC87012 00966000
  168.          KW    'VARIABLE',SETRECVF                             @SC87012 00967000
  169.          KW    'UNDEFINED',SETRECVF                            @SC86295 00968000
  170.          KW    ,                                               @SC87012 00969000
  171.          MEND                                                           00970000
  172. *COPY                                                 KFILSHO           00971000
  173.          MACRO                                                          00972000
  174.          KFILSHO                                                        00973000
  175. .* Specific SHOW FILE handlers (same order as KW).  No operands.        00974000
  176. SHORFM   LA    8,FILRCF                                        @SC88120 00975000
  177.          BAL   14,SHOCHR                                       @SC87012 00976000
  178.           B    SETRFM                                          @SC87166 00977000
  179.          MEND                                                           00978000
  180. *COPY                                                 FDBD              00979000
  181.          MACRO                                                          00980000
  182.          FDBD                                                           00981000
  183. .* Map of File Descriptor Block + File Access Block                     00982000
  184. .* Required items below: FABCOMM, FDBD-FDBLRC, FDBSIZE, FDBDATE,        00983000
  185. .*     FDBDLRTR, FDBCOP, FDBINFO.  See also FDBPAT.                     00984000
  186. LFUID    EQU   4             Length of user id in filespec     @SC90264 00985000
  187. LFFNM    EQU   8             Length of file id in filespec     @SC90264 00986000
  188. LFID     EQU   1+LFUID+LFFNM Length of internal filespec       @SC90264 00987000
  189. LFKEY    EQU   LFUID+LFFNM+5 Length of KSDS key                @SC90264 00988000
  190. FABD     DSECT ,                                               @SC86295 00989000
  191. FABRESP  DS    XL6           Saved response code               @SC90264 00990000
  192. FABNORD  DS    H             Byte count of last transfer       @SC90264 00991000
  193. FDBD     DS    0F            Beginning of short descriptor     @SC86295 00992000
  194. FDBBUFF  DS    A             Buffer ptr                        @SC86295 00993000
  195. FDBBSIZ  DS    F             Max record length                 @SC86295 00994000
  196. FDBRCF   DS    C             Record format                     @SC86295 00995000
  197. FDBFLGS  DS    X             Flags                             @SC86295 00996000
  198. FDBACTV  EQU   X'80'         File is already open              @SC86295 00997000
  199. * SVATT  EQU   X'40'         Preserve attributes               @SC90033 00998000
  200. * APPN   EQU   X'10'         DISP=MOD                          @SC86295 00999000
  201. FDBLRC   DS    H             File record length                @SC86295 01000000
  202. FDBSIZE  DS    F             File size in Kbytes               @SC86299 01001000
  203. FDBCOP   EQU   *-FDBD        Length to copy for OPEN           @SC86295 01002000
  204. FDBDATE  DS    XL7           Time stamp: packed yyyymmddhhmmss @SC88235 01003000
  205. * Must align FABFID to abut FABRN (halfword)                   @SC90264 01004000
  206. FABFID   DS    0CL(LFID)     File designator                   @SC90264 01005000
  207. FABFLGS  DS    X             Flags indicating type of file     @SC90264 01006000
  208. FABFMAIN EQU   X'01'         Flag for MAIN TS queue            @SC90264 01007000
  209. FABFTS   EQU   X'02'         Flag for TS queue                 @SC90264 01008000
  210. FABFTD   EQU   X'04'         Flag for TD queue                 @SC90264 01009000
  211. FABFPGM  EQU   X'08'         Flag for pipe file                @SC90264 01010000
  212. FABFSPL  EQU   X'10'         Flag for spool file               @SC90264 01011000
  213. FABFTAK  EQU   X'20'         Flag for internal Kermit file     @SC90264 01012000
  214. FABFUID  DS    CL(LFUID)     User name                         @SC90264 01013000
  215. FABFNAM  DS    CL(LFFNM)     File name                         @SC90264 01014000
  216. FABRN    DS    H             Record number                     @SC90264 01015000
  217. FDBNREC  DS    H             Number of records                 @SC90264 01016000
  218. FDBFL2   DS    X             More flags                        @SC90264 01017000
  219. FDBXRCF  DS    X             External format flags             @SC90264 01018000
  220. FDBXLRC  DS    H             External old LRECL                @SC90264 01019000
  221. FDBXBLK  DS    H             External old block size           @SC90264 01020000
  222. FDBINFO  EQU   *-FDBD        Length of info returned           @SC86295 01021000
  223. FABIOF   DS    X             More flags                        @SC90264 01022000
  224. FABLRTR  DS    F             Record length for truncation      @SC88120 01023000
  225. FABUWORD DS    F             Reserved for user applications    @SC90264 01024000
  226. FABCOMM  DS    CL8           Command name                      @SC87351 01025000
  227. .* CLOSE     Close file named in FABFID                        @SC90264 01026000
  228. .* CWD       Set new user directory or QFN prefix: string is at@SC90264 01027000
  229. .*           FABFID+2 with 2-byte unsigned length at FABFID    @SC90264 01028000
  230. .* DELETE    Delete file named in FABFID                       @SC90264 01029000
  231. .* OPEN I    Open file named in FABFID for input               @SC90264 01030000
  232. .* OPEN O    Open file named in FABFID for output              @SC90264 01031000
  233. .* READ      Read a record from (already open) file            @SC90264 01032000
  234. .* READ TD   Read a record from (already open) TD queue        @SC90264 01033000
  235. .* READ TS   Read a record from (already open) TS queue        @SC90264 01034000
  236. .* TEST      Check whether file named in FABFID exists         @SC90264 01035000
  237. .* WRIT TD   Write a record to (already open) TD queue         @SC90264 01036000
  238. .* WRIT TS   Write a record to (already open) TS queue         @SC90264 01037000
  239. .* WRITE     Write a record to (already open) file             @SC90264 01038000
  240. FABDWDS  EQU   (*-FABD+7)/8                                    @SC86295 01039000
  241.          MEND                                                           01040000
  242. *COPY                                                 FDBPAT            01041000
  243.          MACRO                                                          01042000
  244.          FDBPAT &N,&RFM,&SIZ                                   @SC88120 01043000
  245. .* Define system-dependent part of output FDB patterns                  01044000
  246. .*  &1: variable-name prefix (or null if defining init. values)         01045000
  247. .*  &2: RECFM (1-char), &3: LRECL (skip rest of FDB if omitted)@SC88120 01046000
  248.          LCLC  &R,&F,&L,&S,&P4                                 @SC90037 01047000
  249.          AIF   ('&N' EQ '').ALC                                @SC86316 01048000
  250. &R       SETC  'RCF'                                           @SC88120 01049000
  251. &F       SETC  'FLGS'                                          @SC88120 01050000
  252. &L       SETC  'LRC'                                           @SC88120 01051000
  253. &S       SETC  'FSIZ'                                          @SC90037 01052000
  254. .ALC     ANOP                                                  @SC86316 01053000
  255. &N&R     DC    C'&RFM'       RECFM                             @SC88120 01054000
  256. &N&F     DC    X'00'         Flags                             @SC88120 01055000
  257.          AIF   ('&SIZ' EQ '').DONE                             @SC88120 01056000
  258. &N&L     DC    Y(&SIZ)       LRECL                             @SC88120 01057000
  259. &N&S     DC    F'0'          File size in Kbytes               @SC90037 01058000
  260. .DONE    ANOP                                                  @SC88120 01059000
  261.          MEND                                                           01060000
  262. *COPY                                                 KFSBLKD  @SC90264 01061000
  263.          MACRO                                                 @SC90264 01062000
  264.          KFSBLK                                                         01063000
  265. .* Map of Kermit File System block                             @SC90264 01064000
  266. KFSBLK   DSECT ,                                               @SC90264 01065000
  267. KFSNEXT  DS    A             Ptr to next block in chain        @SC90264 01066000
  268. KFSPREV  DS    A             Ptr to previous block in chain    @SC90264 01067000
  269. KFSFUID  DS    CL(LFUID)     User name                         @SC90264 01068000
  270. KFSFNAM  DS    CL(LFFNM)     File name                         @SC90264 01069000
  271. KFSDAT   EQU   *             Info about file                   @SC90264 01070000
  272. KFSLRC   DS    H             File record length                @SC90264 01071000
  273. KFSNREC  DS    H             Number of records                 @SC90264 01072000
  274. KFSSIZE  DS    F             File size in bytes                @SC90264 01073000
  275. KFSDATE  DS    XL7           Time stamp: yyyymmddhhmmss        @SC90264 01074000
  276. KFSLEN   EQU   *-KFSDAT      Length of block on disk           @SC90264 01075000
  277.          DS    X             Spare for packing                 @SC90264 01076000
  278. KFSDWDS  EQU   (*-KFSBLK+7)/8                                  @SC90264 01077000
  279.          MEND                                                  @SC90264 01078000
  280. *COPY                                                 KSYSVAR           01079000
  281.          MACRO                                                          01080000
  282.          KSYSVAR                                                        01081000
  283. .* Define system-dependent globally-known variables                     01082000
  284. CSAPTR   DS    F             Ptr to common system area         @SC90264 01083000
  285. RTXTSV   DS    F             Saved register for prompt         @SC89214 01084000
  286. STRBUF   DS    A             Address of string editing buffer  @SC90264 01085000
  287. DSKSTT   DS    (FABDWDS)D    Dummy FAB                         @SC90264 01086000
  288.          ORG   DSKSTT+FDBD-FABD Start of FDB                   @SC90264 01087000
  289. DSKFDB   DS    XL(FDBINFO)   Room for FDB                      @SC86299 01088000
  290.          ORG   DSKSTT+FABFID-FABD Start of file name           @SC90264 01089000
  291. DSKSTNM  DS    CL(LFID)                                        @SC90264 01090000
  292.          ORG   ,                                               @SC90264 01091000
  293. DESTL    DS    H'0'          Length                            @SC86299 01092000
  294. DEST     DS    CL60          Default PREFIX                    @SC90264 01093000
  295. LINLEN   DS    H             Length of invocation buffer       @SC90264 01094000
  296. GTMLEN   DS    F             Length of getmained area          @NL90264 01095000
  297. GTMSAV   DS    F             Saved reg during DMSFREE          @SC90264 01096000
  298. GTLBUFP  DS    A             Ptr to buffer for terminal input  @SC90264 01097000
  299. GTPBPTRS DS    2F            Address and length of input buffer@SC88095 01098000
  300. GTLPRPS  DS    2F            Ptrs to prompt (passed to GETLIN) @SC90264 01099000
  301. ICPRGS   DS    8F            Saved registers for type-out      @SC88026 01100000
  302. ICPFL    DS    X             Flag for type-out interception    @SC87020 01101000
  303. FSCTRMF  DS    X             Flag for terminal activity        @SC90264 01102000
  304. FSCOTP   DS    H             Current screen write adr          @SC90264 01103000
  305. *  Storage for directory scan                                  @SC90264 01104000
  306. NXFFNL   DS    F             Length of pattern                 @SC90264 01105000
  307. NXPTR    DS    F             Current search position           @SC90264 01106000
  308. NXPTR2   DS    F             Current search position for TS    @SC90264 01107000
  309. NXDEST   DS    CL(LFID)      Pattern                           @SC90264 01108000
  310. NXDNAM   EQU   NXDEST+1+LFUID Start of name part               @SC90264 01109000
  311. KUSERID  DS    CL(LFUID)     Userid (to be filled at startup)  @SC90264 01110000
  312. CURFUID  DS    CL(LFUID)     Current userid                    @SC90264 01111000
  313. PTRKFS   DS    A             Ptr to chain of internal files    @SC90264 01112000
  314. PTRFRE   DS    A             Ptr to chain of free blocks       @SC90264 01113000
  315. PTRFREM  DS    A             Ptr to chain of free megablocks   @SC90264 01114000
  316. USRTOTL  DS    F             Total bytes for current user      @SC90264 01115000
  317. TMPBLK   DS    A             Ptr to block for current file     @SC90264 01116000
  318. QFNBP    DS    A             Ptr to ring of QFN buffers        @SC90264 01117000
  319. QFNPTR   DS    A             Ptr to current QFN buffer       1 @SC90264 01118000
  320. QFNSHB   DS    H             Offset to display form of QFN   2 @SC90264 01119000
  321. QFNSHL   DS    H             Length of display form          3 @SC90264 01120000
  322. DSKFL    DS    X             Flags for disk search             @SC90264 01121000
  323. PLOAD    EQU   X'40'         Auxiliary pgm loaded for pipes    @SC90264 01122000
  324. WARB     EQU   X'20'         Arbitrary chars seen              @SC90264 01123000
  325. WFN      EQU   X'08'         Filename contains wild chars      @SC88246 01124000
  326. NFFND    EQU   X'01'         Found at least one file in search @SC90264 01125000
  327. COPID    DS    CL3           CICS operator id                  @LM90264 01126000
  328. CSCRNHT  DS    H             Terminal screen height in lines   @LM90264 01127000
  329. CSCRNWD  DS    H             Screen width in columns           @LM90264 01128000
  330. CSYSID   DS    CL4           Local CICS system name            @LM90264 01129000
  331. KTSGIDNE DS    H             Number of entries per TSGID       @SC91150 01130000
  332. KTSBPSEG DS    X             Log(length of TS segment)         @SC91150 01131000
  333. SCRLSTIO DS    X             Saved I/O code from SCRNIO        @SC91150 01132000
  334.          MEND                                                           01133000
  335. *COPY                                                 KSYSTF            01134000
  336.          MACRO                                                          01135000
  337.          KSYSTF                                                         01136000
  338. .* Define system-dependent globally-known constants and init. variables 01137000
  339. .*  symb .DS + label &P.DEFS mark start of variables/init. values       01138000
  340.          GBLC  &STORDS                                         @SC89268 01139000
  341.          LCLC  &P                                                       01140000
  342.          AIF   ('&SYSECT' EQ '&STORDS').DS                     @SC89268 01141000
  343. &P       SETC  'I'           For initial values                         01142000
  344. WTEXT    STM   14,5,ICPRGS   Save                              @SC89268 01143000
  345.          L     2,=A(ICPTYP)  Call interception routine         @SC89268 01144000
  346.          BR    2                                               @SC89268 01145000
  347. KSYSATOE DC    A(0)          Normal TTY E/A translation        @SC88302 01146000
  348. KSYSETOA DC    A(0)                                            @SC88302 01147000
  349. SYSATR   DC    AL1(ADOT,ABL+2,AI,A7)  ."I7  System type=CICS   @SC90264 01148000
  350. LSYSATR  EQU   *-SYSATR      Length of stuff for A-packet      @SC88273 01149000
  351. KFILE    DC    CL8'KERMFSF'  Name of Kermit file system KSDS   @SC90264 01150000
  352. LIMKFS   DC    A(LIMDSK)     User quota of storage in KSDS     @SC90264 01151000
  353. CUTKFS   DC    A(CUTDSK)     Absolute cutoff ("disk full")     @SC90264 01152000
  354. SYSUID   DC    (LFUID)C'0',C'/'                                @SC90264 01153000
  355. SYSTAKE  DC    C'KSYS.TD'    File id for system KERMINI        @SC90264 01154000
  356. LSYST    EQU   *-SYSTAKE                                       @SC86299 01155000
  357. USRTAKE  DC    C'KINIT.TAKE' User init file                    @SC90264 01156000
  358. LUSRT    EQU   *-USRTAKE                                       @SC86299 01157000
  359. KMAIL1   DC    C'KERMAIL R(_...) ' System cmd for invoking mail@SC91150 01158000
  360. KMAIL2   DC    C' LIST('                                       @SC90037 01159000
  361. KMAIL3   DC    C')'                                            @SC90037 01160000
  362. KPRNT1   DC    C'KERMPRT R(_...) ' System cmd for printing     @SC91150 01161000
  363. KPRNT2   DC    C' OPTIONS('                                    @SC90037 01162000
  364. KPRNT3   DC    C')'                                            @SC90037 01163000
  365. KSUBM1   DC    C'KERMSUB R(_...) ' System cmd to submit job    @SC91150 01164000
  366. KSUBM2   DC    C' OPTIONS('                                    @SC90037 01165000
  367. KSUBM3   DC    C')'                                            @SC90037 01166000
  368. *                                                                       01167000
  369. FSCBEG   DC    H'1'          Screen adr for first output line  @SC90264 01168000
  370. FSCEND   DC    Y(80*22-1)    Limiting screen adr               @SC90264 01169000
  371. KSYSNIT  CSECT                                                 @SC89215 01170000
  372. .DS      ANOP                                                           01171000
  373. &P.DEFS  DS    0D                                                       01172000
  374. *                                                                       01173000
  375. &P.KPRPL DC    AL1(L'KPRPT)                                    @SC87268 01174000
  376. &P.KPRPT DC    C'Kermit-CICS>'                                 @SC90264 01175000
  377.          ORG   &P.KPRPT+20                                     @SC87268 01176000
  378. &P.LNDLM DC    C' '          Initially no delimiter            @SC88095 01177000
  379. &P.LOGNAM DC   C'KLOGxxxx.TS' File id for debug log            @SC90264 01178000
  380. &P.REPNAM DC   C'KREPxxxx.TS' File id for reply from server    @SC90264 01179000
  381.          MEND                                                           01180000
  382. *COPY                                                 KSYSBUF           01181000
  383.          MACRO                                                          01182000
  384.          KSYSBUF                                                        01183000
  385. .* Store buffer ptrs from R1 and increment R1 for specific buffers      01184000
  386. .*                                                                      01185000
  387.          ST    1,STRBUF      Ptr to string editing buffer      @SC90264 01186000
  388.          LA    1,256(,1)                                   8*N @SC90264 01187000
  389.          ST    1,GTLBUFP     Ptr to terminal input buffer      @SC90264 01188000
  390.          LA    1,256(,1)                                   8*N @SC90264 01189000
  391.          ST    1,QFNBP       Ptr to ring of QFN buffers        @SC90264 01190000
  392.          LA    1,((3*(QFNSIZ+4)+7)/8)*8(,1)                8*N @SC90264 01191000
  393.          MEND                                                           01192000
  394. *COPY                                                 SSYMS             01193000
  395.          MACRO                                                          01194000
  396.          SSYMS                                                          01195000
  397. .* Set global symbols for conditional assembly                          01196000
  398.          GBLC  &KVRSN,&KSYS,&KDATE,&RTN,&TYPCMD,&S1CMD,&KCONT  @SC88309 01197000
  399.          GBLC  &KEDIT,&STORDS,&KTAG,&AEACMD                    @SC90173 01198000
  400.          GBLC  &USER                                           @SC90264 01199000
  401.          GBLA  &MAXLR,&MAXBS                                   @SC86268 01200000
  402. &KSYS    SETC  'CICS'        System name                       @SC90264 01201000
  403.   MNOTE '*** Kermit-&KSYS release &KVRSN..&KEDIT &KTAG (&KDATE) ***'    01202000
  404. &MAXLR   SETA  32767         Max lrecl                         @SC91150 01203000
  405. &MAXBS   SETA  32767         Max blksize                       @SC86268 01204000
  406. &S1CMD   SETC  '0X''0'''     S/1 command prefix                @SC90264 01205000
  407. &AEACMD  SETC  '0X''0'''     AEA command prefix (X'F3'=WSF)    @SC90173 01206000
  408. &KCONT   SETC  'T'           Default controller type (TTY)     @SC88309 01207000
  409. LIMDSK   EQU   100000        User disk space quota for KSDS    @SC90264 01208000
  410. CUTDSK   EQU   150000        Storage cutoff ("disk full")      @SC90264 01209000
  411. QFNSIZ   EQU   54            Length of quoted file name        @SC90264 01210000
  412. MAXWT    EQU   1024          Max TTY write buffer              @SC90264 01211000
  413. MAXRT    EQU   1024          Max TTY read buffer               @SC90264 01212000
  414. MAXWS    EQU   1920          Max fullscreen input buffer       @SC90277 01213000
  415. MAXRS    EQU   1920          Max fullscreen output buffer      @SC90277 01214000
  416. MAXDOF   EQU   LFKEY         Data offset into buffer           @SC90264 01215000
  417. STMGT    EQU   0             Overhead for storage mngmnt       @SC90264 01216000
  418. &TYPCMD  SETC  'TYPE'        Host command for TYPE             @SC90264 01217000
  419. TYPMIN   EQU   2             Min abbrv of system TYPE cmd or 2 @SC90264 01218000
  420. FBRK1    EQU   C'<'          Starting character for options    @SC89218 01219000
  421. FBRK2    EQU   C'>'          Ending character for options      @SC89218 01220000
  422. KMAXE    EQU   1920          < 9025  Kermit extended max pkt   @SC90264 01221000
  423. STKDWDS  EQU   511           Size of save-area stack           @SC87012 01222000
  424. &STORDS  SETC  'DFHEISTG'    Append Kermit globals to STG      @SC90264 01223000
  425. KSUBBASE EQU   12            Base register for CSECT           @SC89268 01224000
  426. KWRKBASE EQU   11            Base register for work area       @SC89268 01225000
  427. &USER    SETC  'OPID'        Use OPID for id                   @SC90264 01226000
  428.          WXTRN KVALID        External security routine         @SC90264 01227000
  429.          WXTRN KHOST,KHIDE   External security routine         @SC90264 01228000
  430.          MEND                                                  @SC86268 01229000
  431. *COPY                                                 SYSMACS           01230000
  432.          MACRO                                                          01231000
  433.          SYSMACS                                                        01232000
  434. .* Include system control block definition macros and list all macros   01233000
  435.  MNOTE '---COPIES: DFHCSADS, DFHDCTDS, DFHTSMDS'                        01234000
  436.  MNOTE '---MACROS: DFHEIEND, DFHEIENT, DFHEIRET, DFHEISTG,'             01235000
  437.  MNOTE '---        EXEC'                                                01236000
  438.          KFSBLK ,                                              @SC90264 01237000
  439.          COPY  DFHCSADS                                        @SC90264 01238000
  440. DCTCBAR  EQU   8             Ptr to DCT entry                  @SC90264 01239000
  441.          COPY  DFHDCTDS                                        @SC90264 01240000
  442.          AIF   ('&SYSPARM' GE '1.7').CICS2                     @SC90264 01241000
  443. TDDCTSDS EQU   TDDCTCBA      Ptr to DCB info CICS 1.6          @SC90264 01242000
  444. DCTSDSTF EQU   DCTDSTYP      TYPEFILE status                   @SC90264 01243000
  445. DCTSDSOP EQU   X'80'         Output                            @SC90264 01244000
  446. DCTSDSRF EQU   DCTDSCDT+36                                     @SC90264 01245000
  447. DCTSDSBL EQU   DCTDSCDT+62                                     @SC90264 01246000
  448. DCTSDSRL EQU   DCTDSCDT+82                                     @SC90264 01247000
  449. .CICS2   ANOP                                                  @SC90264 01248000
  450. TSMAPBAR EQU   1                                               @SC90264 01249000
  451. TSGIDBAR EQU   1                                               @NL90264 01250000
  452. TSUTBAR  EQU   1                                               @NL90264 01251000
  453. TSUTEAR  EQU   1                                               @NL90264 01252000
  454.          COPY  DFHTSMDS                                        @SC90264 01253000
  455.          DROP  TSMAPBAR                                        @SC90264 01254000
  456.          DFHEISTG ,                                            @SC90264 01255000
  457.          MEND                                                  @SC86268 01256000
  458. *COPY                                                 STRTMSGS          01257000
  459.          MACRO                                                          01258000
  460. &LABEL   STRTMSGS                                                       01259000
  461. .* Print system-dependent start-up messages                             01260000
  462. &LABEL   CLI   S1HND,XON                                       @SC87338 01261000
  463.          BNE   STRT1Z                                          @SC87338 01262000
  464.          CLI   TRMTP,C'T'                                      @SC87338 01263000
  465.          BE    STRT1Z                                          @SC87338 01264000
  466.          WTEXT 'Handshake is XON -- not needed'                @SC87338 01265000
  467. STRT1Z   DS    0H                                              @SC87338 01266000
  468.          MEND                                                  @SC87338 01267000
  469. *COPY                                                 KMAIN             01268000
  470.          MACRO                                                          01269000
  471. &LABEL   KMAIN &TYPE                                                    01270000
  472. .* Linkage conventions with system.                                     01271000
  473. .*  &1: ENTER if entering, RETURN if returning                          01272000
  474.          GBLC  &RTN                                            @SC90264 01273000
  475.          AIF   ('&TYPE' NE 'RETURN').ENT                       @SC89268 01274000
  476. &LABEL   DS    0H                                              @SC90264 01275000
  477.          L     DFHEIBR,DFHEIBP                                 @SC91150 01276000
  478.          USING DFHEIBLK,DFHEIBR                                @SC91150 01277000
  479.          ICM   2,15,DFHEICAP Any comm area?                    @SC91150 01278000
  480.          BZ    KR&SYSNDX     No, issue a read                  @SC91150 01279000
  481.          CLC   EIBCALEN,=H'7' Length of comm area?             @SC91150 01280000
  482.          BL    KR&SYSNDX     Not long enough for a return code @SC91150 01281000
  483.          MVC   0(7,2),=C'R(....)'  Set up for return code      @SC91150 01282000
  484.          STM   15,15,2(2)    Ok return it                      @SC91150 01283000
  485. KR&SYSNDX DS   0H                                              @SC91150 01284000
  486.          DROP  DFHEIBR                                         @SC91150 01285000
  487.          DFHEIRET            Unlink                            @SC90264 01286000
  488.          MEXIT ,                                               @SC89268 01287000
  489. .ENT     AIF   ('&TYPE' NE 'ENTER').OTH                        @SC89268 01288000
  490. &LABEL   DFHEIENT DATAREG=(KWRKBASE),CODEREG=(KSUBBASE),       @LM90264+01289000
  491.                EIBREG=(4)                                      @SC90264 01290000
  492.          L     10,=A(COMMON) Common code addressibility        @SC86316 01291000
  493.          LA    0,STORAG                                        @SC86295 01292000
  494.          LA    1,8*STODWDS   Length of storage                 @SC86295 01293000
  495.          SR    15,15         Zero fill                         @SC86295 01294000
  496.          MVCL  0,14                                            @SC86295 01295000
  497.          LR    15,0          Start of stack                    @SC86295 01296000
  498.          A     0,=A(8*STKDWDS) End of stack                    @SC87012 01297000
  499.          STM   15,0,STKPTR                                     @SC86295 01298000
  500.          ST    15,STKLO                                        @SC89089 01299000
  501.          LR    15,KSUBBASE   Get entry address                 @SC90264 01300000
  502.          MEXIT ,                                               @SC89268 01301000
  503. .OTH     MNOTE 12,'Invalid type &TYPE'                         @SC89268 01302000
  504.          MEND                                                  @SC87338 01303000
  505. *COPY                                                 SETUSER  @SC90264 01304000
  506.          MACRO                                                 @SC90264 01305000
  507. &LABEL   SETUSER                                                        01306000
  508. .* Grab appropriate userid according to global symbol &USER    @SC90264 01307000
  509. .* The code can use R0-9,14,15 but should avoid USING's        @SC90264 01308000
  510. .* Valid values: OPID, TERM, OTHER.                            @SC90264 01309000
  511.          GBLC  &USER                                           @SC90264 01310000
  512.          AIF   ('&USER' NE 'OPID').CHKTRM                      @SC90264 01311000
  513. &LABEL   MVC   KUSERID(3),COPID Set default directory          @SC90264 01312000
  514.          MVI   KUSERID+3,C' '                                  @SC90264 01313000
  515.          MEXIT                                                 @SC90264 01314000
  516. .CHKTRM  AIF   ('&USER' NE 'TERM').CHKOTH                      @SC90264 01315000
  517. &LABEL   L     15,DFHEIBP                                      @SC90264 01316000
  518.          MVC   KUSERID,EIBTRMID-DFHEIBLK(15)                   @SC90264 01317000
  519.          MEXIT                                                 @SC90264 01318000
  520. .CHKOTH  AIF   ('&USER' NE 'OTHER').ERR                        @SC90264 01319000
  521.          KCALL KUSER,KUSERID,EXT                               @SC90264 01320000
  522.          MEXIT                                                 @SC90264 01321000
  523. .ERR     MNOTE 12,'Invalid USER type &USER'                    @SC90264 01322000
  524.          MEND                                                  @SC90264 01323000
  525. *COPY                                                 SAVE              01324000
  526.          MACRO                                                          01325000
  527. &LABEL   SAVE  ®S,&DUM,&TAG                                 @SC90264 01326000
  528. .* Save registers as in OS type-1 linkage                               01327000
  529. .*  &1: (reg1,reg2) to save, &2 is not used, &3: optional eyecatcher    01328000
  530.          LCLA  &LEN,&OFF                                       @SC90264 01329000
  531.          LCLC  &NAME                                           @SC90264 01330000
  532.          AIF   (N'®S NE 2).ER1                              @SC90264 01331000
  533.          AIF   ('&TAG' EQ '').NOTAG                            @SC90264 01332000
  534.          AIF   ('&TAG' EQ '*').DEFTAG                          @SC90264 01333000
  535. &NAME    SETC  '&TAG'                                          @SC90264 01334000
  536. &LEN     SETA  K'&TAG                                          @SC90264 01335000
  537.          AGO   .SETTAG                                         @SC90264 01336000
  538. .DEFTAG  ANOP                                                  @SC90264 01337000
  539. &NAME    SETC  '&LABEL'                                        @SC90264 01338000
  540. &LEN     SETA  1                                               @SC90264 01339000
  541.          AIF   ('&LABEL' NE '').LOOPC                          @SC90264 01340000
  542. &NAME    SETC  '&SYSECT'                                       @SC90264 01341000
  543. .LOOPC   AIF   ('&NAME'(1,&LEN) EQ '&NAME').SETTAG             @SC90264 01342000
  544. &LEN     SETA  &LEN+1                                          @SC90264 01343000
  545.          AGO   .LOOPC                                          @SC90264 01344000
  546. .SETTAG  ANOP                                                  @SC90264 01345000
  547. &OFF     SETA  ((&LEN+6)/2)*2                                  @SC90264 01346000
  548. &LABEL   B     &OFF.(,15)    Skip over tag                     @SC90264 01347000
  549.          DC    AL1(&LEN)     Length of tag                     @SC90264 01348000
  550.          DC    C'&NAME'      Tag                               @SC90264 01349000
  551.          AGO   .STOR                                           @SC90264 01350000
  552. .NOTAG   ANOP                                                  @SC90264 01351000
  553. &LABEL   DS    0H                                              @SC90264 01352000
  554. .STOR    AIF   (T'®S(1) NE 'N').ER1                         @SC90264 01353000
  555. &OFF     SETA  ®S(1)*4+20                                   @SC90264 01354000
  556.          AIF   (&OFF LE 75).OFFOK                              @SC90264 01355000
  557. &OFF     SETA  &OFF-64                                         @SC90264 01356000
  558. .OFFOK   STM   ®S(1),®S(2),&OFF.(13)  Save               @SC90264 01357000
  559.          MEXIT                                                 @SC90264 01358000
  560. .ER1     MNOTE 12,'INVALID REGISTER LIST ®S'                @SC90264 01359000
  561.          MEND                                                  @SC90264 01360000
  562.